home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / XORS.HDR < prev   
Text File  |  1994-04-25  |  1KB  |  44 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _XORS( cData, cKey ) --> cStringInt
  8.  
  9. PARAMETERS:
  10.  
  11. cData  : Binary Number to XOR with cKEY
  12. cKey   : Binary Number to XOR with cData
  13.  
  14. SHORT:
  15.  
  16. Perform a binary Exclusive OR with binary STRINGS.
  17.  
  18. DESCRIPTION:
  19.  
  20. _XORS() performs a bitwise XOR or two binary numbers in STRING format.
  21.  
  22. The two numbers are padded to the same number of positions (The length of
  23. the larger number) before the operation takes place in order to
  24. retain positional values:
  25.  
  26. 100101 XORS 101    becomes    100101 XORS 000101
  27.  
  28. NOTE:
  29.  
  30.  
  31.  
  32. EXAMPLE:
  33.  
  34. t = _XORS('1011','11')
  35.  
  36. original '1011'   Both params are padded to eight places 1010
  37. key      '11'                                            0011
  38.                                                          ----
  39.                                            Result:       1001
  40.  
  41. Result: t = "1001"
  42.  
  43. ******************************************************************************/
  44.